<template>
  <div class="layout-page pt-32px">
    <div class="layout-page-inner w-1328px bg-white p-32px">
      <h1 class="font-size-32px text-center fw-500">联盟单位</h1>
      <div class="h-1px bg-#d8d8d8 my-40px"></div>
      <div class="flex flex-wrap justify-center mb--16px">
        <img
          v-for="unit in unitList"
          :key="unit.id"
          :src="unit.linkPicUrl"
          class="w-200px h-84px mb-24px mr-20px"
          :class="{ 'cursor-pointer': unit.openUrl }"
          alt=""
          @click="openLink(unit.openUrl)"
        />
      </div>
    </div>
  </div>
</template>

<script setup>
import { useConfigStore } from "@/store";

const configStore = useConfigStore();
const unitList = computed(() => configStore.configList?.unitList);

const openLink = (url) => {
  if (!url) return;
  window.open(url);
};
</script>
